package com.ptswitch.material.service;

import java.util.Collection;
import java.util.List;

import com.ptswitch.material.model.common.Uzer;
import com.ptswitch.material.model.security.Role;
import com.ptswitch.material.model.security.RolePermission;
import com.ptswitch.material.model.security.UserRole;

public interface RoleService {

    void initRoles();

    //
    List<Uzer> listUserByRoleInfo(long roleId, String username, boolean in, long first, long size);

    long countUserByRoleInfo(long roleId, String username, boolean in);

    //
    Role findById(long id);

    List<Role> findRoles(Role... roles);

    List<Role> findRoles(List<Role> roles);

    List<Role> findRoles(Collection<Long> roleIds);

    List<Role> findByRoleGroup(String roleGroup);

    List<Role> findNormalRoles();

    List<Role> findRelateRoles();

    void save(Role role);

    List<Role> findAll();

    void saveRolePermissions(List<RolePermission> rps);

    void saveUserRoles(List<UserRole> urs);
}
